<?php
namespace app\common\validate;

use think\Validate;

class HallValidate extends Validate
{
    protected $rule =   [
        'id'                      => 'require|integer',
        'page|页数'               => 'require|integer',
        'limit|条数'              => 'require|integer',
        'type|类型'               => 'require|integer',
        'title|标题'              => 'require|length:1,200',
        'head_img|图片'           => 'require|image',
        'price|价格'              => 'require',
        'address|地址'            => 'require|length:1,200',
        'start_time|时间'         => 'require|date',
        'end_time|时间'           => 'require|date',
        'target|培训目标'         => 'require|length:1,200',
        'target_decode|目标解读'  => 'require',
        'course|课程安排'         => 'require',
        'learn_status|学习形式'   => 'require|length:1,200',
        'sign_ask|报名条件'       => 'require|length:1,200',
        'sign_money|报名费用'     => 'require|length:1,200',
    ];
    
    protected $scene = [
        /** admin */
        'show'     => ['id'],
        'list'     => ['page', 'limit'],
        'add'      => ['type', 'title', 'head_img', 'price', 'address', 'start_time', 'end_time', 'target', 'target_decode', 'course', 'learn_status', 'sign_ask', 'sign_money'],
        'edit'     => ['id', 'type', 'title', 'price', 'address', 'start_time', 'end_time', 'target', 'target_decode', 'course', 'learn_status', 'sign_ask', 'sign_money'],
        'edit_img' => ['id', 'type', 'title', 'head_img', 'price', 'address', 'start_time', 'end_time', 'target', 'target_decode', 'course', 'learn_status', 'sign_ask', 'sign_money'],
    ];
}